package cn.iocoder.yudao.module.enterprise.dal.mysql.account;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.enterprise.controller.admin.account.vo.AccountPageReqVO;
import cn.iocoder.yudao.module.enterprise.dal.dataobject.account.AccountDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 碳排放核算 Mapper
 *
 * @author Steven
 */
@Mapper
public interface AccountMapper extends BaseMapperX<AccountDO> {

    default PageResult<AccountDO> selectPage(AccountPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AccountDO>()
                .likeIfPresent(AccountDO::getName, reqVO.getName())
                .eqIfPresent(AccountDO::getCycleType, reqVO.getCycleType())
                .orderByDesc(AccountDO::getId));
    }

}
